function [ img_mean, img_var ] = UpdateMeanAndVar( img_color, img_mean, img_var, bw )
%UPDATEMEANANDVAR Summary of this function goes here
%   Detailed explanation goes here
%Update mean and variances

	for x = 1 : size(bw,1)
        for y = 1 : size(bw,2)
            if(bw(x,y) == 0)
                for z = 1 : 3
                    img_mean(x,y,z) = (0.05 * img_color(x,y,z)) + ((1.0-0.05) * img_mean(x,y,z));
                 	img_var(x,y,z) = (0.05 * (img_color(x,y,z)-img_mean(x,y,z))^2) + ((1-0.05)*img_var(x,y,z));
                end
            end
    	end
    end

end

